<template>
	<div>
		<el-button type="primary" @click="onMapSelect">地址选择</el-button>
		<div>
			<p>位置：{{ adressInfo.address }}</p>
			<p>longitude：{{ adressInfo.longitude }}</p>
			<p>latitude：{{ adressInfo.latitude }}</p>
		</div>
		<DialogMapSelect :visible="mapVisible" @get-adress="getAdress" @cancel="mapCancel"></DialogMapSelect>
	</div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import DialogMapSelect from './components/DialogMapSelect.vue'

const mapVisible = ref(false)
const onMapSelect = () => {
	mapVisible.value = true
}
const mapCancel = () => {
	mapVisible.value = false
}

let adressInfo = ref<any>({})
const getAdress = (data: any) => {
	adressInfo.value = data
}
</script>
